"""

Roket Secure Language - Builtin Class (Map)

"""

from Builtins import BuiltinC, BuiltinF
from RSB import Obj

class ExceptionBIC(BuiltinC):
	def __init__(self, type):
		# Call the parent function
		super(ExceptionBIC, self).__init__(type)
		
		# Then associate our functions
		self.constructor = ExceptionBICC("__init__", ["self"])
		self.variables["text"] = "<not set>";
		self.variables["file"] = "<unknown>";
		self.variables["line"] = 0;
	
	def clone(self):
		# This function is used when a new instance of the class is created.
		c = Obj(self.type);
		c.variables = self.variables.copy()
		c.functions = self.functions.copy()
		c.events = self.events.copy()
		if (self.constructor != None):
			c.constructor = self.constructor
		else:
			c.constructor = None
		return c

class ExceptionBICC(BuiltinF):
	def execute(self, engine, args):
		# Nothing required for this class.
		pass